class Operation < ActiveRecord::Base
  belongs_to :operation_type
  belongs_to :share

  validates_presence_of :timestamp, :quantity, :price, :brokerage, :share
  validates_numericality_of :quantity, :price, :brokerage

  def split?
    self.operation_type_id == 3
  end
  
  def rightToAcquire?
    self.operation_type_id == 4
  end

end
